package com.mls.fivedistrict.pojo;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableLogic;
import com.baomidou.mybatisplus.annotations.TableName;

import java.io.Serializable;


import com.baomidou.mybatisplus.enums.IdType;
import lombok.Data;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.NotNull;

/**
 * <p>
 * <p>
 * </p>
 *
 * @author Five Team
 * @since 2018-07-02
 */
@Data
@Accessors(chain = true)
@TableName("t_shipping_address")
public class ShippingAddress extends Model<ShippingAddress> {

    private static final long serialVersionUID = 1L;
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    private Long userId;
    /**
     * 收货地址
     */
    @NotBlank(message = "地址不能为空")
    private String address;
    /**
     * 是否为默认地址
     */
    private Boolean isDefault;
    /**
     * 收货手机号码
     */
    @NotBlank(message = "收货手机号码不能为空")
    private String phone;
    /**
     * 收货人
     */
    @NotBlank(message = "收货人不能为空")
    private String consignee;

    @TableLogic
    private Boolean isDelete;
    private Boolean isEnable;
    /**
     * 省
     */
    @NotBlank(message = "省不能为空")
    private String province;

    /**
     * 市
     */
    @NotBlank(message = "市不能为空")
    private String city;
    /**
     * 区
     */
    private String district;

    public Boolean getDefault() {
        return isDefault;
    }

    public void setDefault(Boolean aDefault) {
        isDefault = aDefault;
    }

    public Boolean getDelete() {
        return isDelete;
    }

    public void setDelete(Boolean delete) {
        isDelete = delete;
    }

    public Boolean getEnable() {
        return isEnable;
    }

    public void setEnable(Boolean enable) {
        isEnable = enable;
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
